package com.xuecheng.swagger.controller;

import com.xuecheng.swagger.entity.Student;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 陶刚专属
 * @Date 2021-08-03 19:58
 * @Version: 1.0
 **/
@Api(tags = "hello controller 测试")
public interface HelloApi {


    @ApiOperation("测试 hello方法")
    String hello();


    @ApiOperation("测试 queryString的方法")
    @ApiImplicitParam(name = "num", value = "学生编号", dataType = "String", paramType = "query")
    Student modifyStudentNum(@RequestParam("num") String num);


    @ApiOperation("测试 path的方法")
    @ApiImplicitParam(name = "name", value = "学生姓名", dataType = "String", paramType = "path")
    Student modifyStudentName(@PathVariable("name") String name);


    @ApiOperation("测试 聚和参数的方法")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "num", value = "学生编号", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "name", value = "学生姓名", dataType = "String", paramType = "path")
    })
    Student mofidyStudentBynNum(@PathVariable("id") String id,
                                @RequestParam("name") String name,
                                @RequestBody Student student);
}
